Skip to content

P1 pilot: read lingcod data from data-lectures#792

Merged
mmcky merged 1 commit into
mainfrom
datasets/p1-lingcod
Jul 17, 2026
Merged

P1 pilot: read lingcod data from data-lectures#792
mmcky merged 1 commit into
mainfrom
datasets/p1-lingcod

Conversation

@mmcky

@mmcky mmcky commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

The lecture half of pilot P1 — local-path static (QuantEcon/meta#338). Repoints msy_fishery at the canonical copy in QuantEcon/data-lectures and drops the local one, which nothing else reads. Paired with QuantEcon/data-lectures#12.

Draft — blocked on merge order. The URL 404s until the data is on data-lectures main: QuantEcon/data-lectures#10 (restructure), then QuantEcon/data-lectures#12 (the data + manifest). CI here cannot pass before those land. That is not a defect in this PR — it is the pilot's main finding, below.

This fixes the lecture, it doesn't just relocate the data

The read was a relative pathpd.read_csv('datasets/lingcod_msy_recovery.csv') — which only resolves inside a repo checkout. A downloaded notebook has no datasets/ directory, so this cell raised FileNotFoundError in Colab. Reading over https is what makes the notebook self-contained, which is exactly the P1 exit test.

Finding: the convention has a merge-order constraint, and it needs stating

The data repo's README promises "the lecture PR builds green immediately, no two-step merge." True — but only once the data is on the data repo's default branch. Probed directly:

URL Result
.../data-lectures/raw/main/lectures/lingcod_msy_recovery.csv 404 — data not merged yet
.../data-lectures/raw/datasets/p1-lingcod/lectures/... 200 — resolves today

The branch URL is right there and would turn this PR green instantly. Taking it would recreate the exact bug QuantEcon/meta#337 is cleaning upmle.md has been pinned to a non-default branch of high_dim_data since 2023, and that pin is precisely why the branch cannot be deleted today. So the order is: data PR first, lecture PR second. Each is a single step, but the order is load-bearing and belongs in QuantEcon/QuantEcon.manual#108.

Verification

Ran this lecture's own cell against the data over https (branch ref substituted, since main 404s): 82 rows fetched, figure renders, no exception, and the terminal-year null in F_over_Fmsy passes through fill_between/plot cleanly.

Output cannot move: the migrated file is byte-identical to the copy removed here (sha256 fc2f873f...), verified before the repoint.

Uses the interim URL form and the data_url convention already used by long_run_growth and inflation_history.

Part of QuantEcon/meta#338
See QuantEcon/meta#336

Repoints msy_fishery at the canonical copy in QuantEcon/data-lectures and
drops the local one, which nothing else reads.

This also fixes the lecture rather than merely relocating its data. The read
was a relative path, 'datasets/lingcod_msy_recovery.csv', which only resolves
inside a repo checkout — a downloaded notebook has no datasets/ directory, so
the cell raised FileNotFoundError in Colab. Reading over https is what makes
the notebook self-contained.

Uses the interim URL form github.com/QuantEcon/data-lectures/raw/main/… and
the data_url convention already used by long_run_growth and inflation_history.

Blocked until the data is on data-lectures main (QuantEcon/data-lectures#10,
then #11) — until then this URL 404s. The branch URL resolves today, but
pointing at a non-default ref is exactly the bug meta#337 is cleaning up in
mle.md, so it is not a shortcut worth taking.

Verified by running the cell against the data over https: 82 rows, figure
renders, terminal-year null in F/Fmsy handled. Output is unchanged — the
migrated file is byte-identical (sha256 fc2f873f…) to the copy removed here.

Part of QuantEcon/meta#338
See QuantEcon/meta#336

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@netlify

netlify Bot commented Jul 15, 2026

Copy link
Copy Markdown

Deploy Preview for taupe-gaufre-c4e660 ready!

Name Link
🔨 Latest commit 1c08a7e
🔍 Latest deploy log https://app.netlify.com/projects/taupe-gaufre-c4e660/deploys/6a58187ecf135a00087e69db
😎 Deploy Preview https://deploy-preview-792--taupe-gaufre-c4e660.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the msy_fishery lecture to load the lingcod MSY recovery dataset via HTTPS from the canonical copy in QuantEcon/data-lectures, making the notebook self-contained when run outside a repository checkout.

Changes:

  • Replace the local relative-path pd.read_csv('datasets/lingcod_msy_recovery.csv') with a data_url pointing at QuantEcon/data-lectures on main.
  • Remove the no-longer-used local CSV from lectures/datasets/.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
lectures/msy_fishery.md Switches dataset loading to an HTTPS data_url hosted in QuantEcon/data-lectures.
lectures/datasets/lingcod_msy_recovery.csv Deletes the local dataset copy now that the lecture reads from the canonical remote source.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown

@github-actions
github-actions Bot temporarily deployed to pull request July 17, 2026 00:14 Inactive
@github-actions
github-actions Bot temporarily deployed to pull request July 17, 2026 00:15 Inactive
mmcky added a commit to QuantEcon/data-lectures that referenced this pull request Jul 17, 2026
The plan gated the first repoint (Phase 8) on data integrity (Phase 7's
byte-compare) but on no operational guardrail: the ordering note let a lecture
go live against an unprotected main with no CI. With the P1 repoint
(QuantEcon/lecture-python-intro#792) about to merge, that gap becomes real —
raw/main becomes a production URL the moment it lands.

- Phase 5 gains a "go-live guardrails" subset, prerequisite for Phase 8:
  branch protection on main (ruleset added 2026-07-17: PRs required with zero
  approvals so a solo maintainer can still merge, force-pushes and deletion
  blocked), and a minimal consumed-file CI check (every lectures/ file with a
  non-empty consumers list exists and matches its manifest sha256). The full
  automation suite keeps its own pace.
- Ordering note updated to name the new gate.

This is the last direct push to main; the ruleset lands immediately after.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mmcky
mmcky merged commit 48659c2 into main Jul 17, 2026
8 of 10 checks passed
@mmcky
mmcky deleted the datasets/p1-lingcod branch July 17, 2026 00:31
mmcky added a commit to QuantEcon/data-lectures that referenced this pull request Jul 17, 2026
The P1 repoint merged 2026-07-17 (QuantEcon/lecture-python-intro#792), making
this the first repo state where a production lecture reads from lectures/ at
build time. Record it where the rules live:

- PLAN.md: tick the Phase 8 P1 item with the evidence — lecture build green in
  the single repoint PR, served raw/main URL verified byte-identical to the
  manifest sha256, Colab-unchanged holds by construction (public URL replaces
  the relative path that broke downloaded notebooks). The pyodide/CORS bullet
  stays open. Status line now says LIVE; the go-live guardrail bullet records
  that consumed-files became a required status check.
- AGENTS.md: "freedom is now spent" updated from prospective to actual — the
  repo is live, published filenames are an API, and the protect-main ruleset
  (PRs only, no force-push, required consumed-files check) enforces it.

See QuantEcon/meta#338

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants